package com.bawei.bydayzg_two.adapter

import android.graphics.Paint
import android.widget.TextView
import com.bawei.base.bean.GoodsItem0
import com.bawei.base.bean.GoodsResult
import com.bawei.bydayzg_two.R
import com.bawei.bydayzg_two.Utils.GildUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class GoodsAdapter:BaseQuickAdapter<GoodsItem0,BaseViewHolder>(R.layout.item_goods) {
    override fun convert(holder: BaseViewHolder, item: GoodsItem0) {
        GildUtils.loadYJ(context,item.image,holder.getView(R.id.goods_img),30)
        //
        holder.setText(R.id.goods_name,item.storeName)
        holder.setText(R.id.goods_money,"￥${item.price}")
        holder.setText(R.id.goods_otprice,"￥${item.otPrice}")
        holder.setText(R.id.goods_sale,"已售出:${item.sales+item.ficti}件")//总销售未成功的加虚拟销售量
        holder.getView<TextView>(R.id.goods_otprice).paintFlags = Paint.STRIKE_THRU_TEXT_FLAG//设置双划线
    }
}